﻿@using Projectmanagement.Models
@{
    ViewBag.Title = "Construct";
}
@(Html.Telerik().Grid<_Construct>()
                                    .Name("Construct")
    .DataKeys(keys => { keys.Add(item => item.ID); })
    .ToolBar(toolBar => toolBar.Template(
                @<text> 搭建表： <a class="t-button t-grid-add" href="/Construct?Construct-mode=insert">
                    新增记录</a>
</text>
                ))
        .DataBinding(dataBinding =>
        {
            dataBinding.Ajax()
            .Select("_SelectIndex", "Construct")
            .Insert("_InsertAjaxEditing", "Construct")
            .Update("_SaveAjaxEditing", "Construct")
            .Delete("_DeleteAjaxEditing", "Construct");
        })
            .Columns(columns =>
            {
                columns.Bound(item => item.ComyanyName).Width(100);
                columns.Bound(item => item.ConstructName).Width(100);
                columns.Bound(item => item.ConstructPost).Width(100);
                columns.Bound(item => item.ConstructWay).Width(100);

                columns.Command(commands =>
                {
                    commands.Edit();
                    commands.Delete();
                }).Title("操作").Width(200);
            }).Resizable(r => r.Columns(true))
            .Editable(editing => editing.Mode(GridEditMode.PopUp))
              .Pageable(item => item.Style(GridPagerStyles.Status).PageSize(50).PageOnScroll(true)).Scrollable(s => s.Height(600)).Scrollable(c => c.Height(600))
    .Resizable(resizing => resizing.Columns(true))
            .Sortable()
        )
<script type="text/javascript">



    function OnComplete(e) {
        $(".t-button.t-button-icontext.t-upload-action").remove();
    }
</script>
